﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using Autofac;
using GC_FFW.BusinessEntities.Abstractions.Interfaces.Forecast;
using GC_FFW.BusinessEntities.Enums.Soccerfame;
using GC_FFW.BusinessEntities.Forecast;
using GC_FFW.ForecastWriter.Abstractions.Interfaces.Builders;
using GC_FFW.ForecastWriter.Modules.Autofac;
using GC_FFW.SoccerfameParser.Abstractions.Interfaces.Builders;
using GC_FFW.SoccerfameParser.Abstractions.Interfaces.Factories;
using GC_FFW.SoccerfameParser.Modules.Autofac;

namespace GC_FFW.Tests
{
	class Program
	{
		static void Main(string[] args)
		{
			//var builder = new ContainerBuilder();
			//builder.RegisterModule(new ForecastWriterModule());
			//builder.RegisterModule(new SoccerfameParserModule());
			//var diContainer = builder.Build();

			//var forecastBuilder = diContainer.Resolve<IForecastBuilder>();
			//var fsb = diContainer.Resolve<IForecastStructureBuilder>();
			//var forecastDataBuilder = diContainer.Resolve<IForecastDataBuilder>();

			//var factory = diContainer.Resolve<IAdapterFactory>();
			//if (factory != null)
			//{
			//	var matchAdapter = factory.CreateMatchAdapter();
			//	if (matchAdapter != null)
			//	{
			//		var s = matchAdapter.GetEvents("http://www.soccerfame.ru/match/362138/chelsea/stoke-city", new List<EventType>
			//		{
			//			EventType.OwnGoal,
			//			EventType.Penalty,
			//			EventType.RegularGoal
			//		});

			//		Console.WriteLine(s.Count());

			//		foreach (var _event in s)
			//		{
			//			Console.WriteLine(_event.Player.Name);
			//			Console.WriteLine(_event.Time);
			//		}
			//	}
			//}

			for (int i = 0; i < 50; i++)
			{
				var request = (HttpWebRequest)WebRequest.Create("http://alexbetting.com/freetips/prognoz/6561/");
				request.Method = "GET";

				using (WebResponse response = request.GetResponse())
				{

				}
			}
		}
	}
}
